Skip to content

Fix xmlns emission for unqualified schemas and make it prefix-dependent#261

Merged
Bergmann89 merged 2 commits intomasterfrom
issue-256
Mar 26, 2026
Merged

Fix xmlns emission for unqualified schemas and make it prefix-dependent#261
Bergmann89 merged 2 commits intomasterfrom
issue-256

Conversation

@Bergmann89
Copy link
Copy Markdown
Owner

Related to #256

When using some of the helper methods to add render steps to the config,
some of the steps were added twice. This commit fixes that by ensuring
that the helper methods only add the render step if it hasn't been added
already.
Emit suitable namespace declarations (xmlns) on the root element for
schemas with unqualified elements. In XSD, global elements are always
namespace-qualified regardless of elementFormDefault, so the root
element must declare its namespace even when local elements are
unqualified.

Additionally, make the emitted xmlns prefix depend on the tag name
passed to the serializer at runtime. If the name contains a prefix
(e.g. "tns:Element"), the declaration uses that prefix
(xmlns:tns="..."); otherwise it emits the default namespace
(xmlns="...").
@Bergmann89 Bergmann89 merged commit 7e95af5 into master Mar 26, 2026
2 checks passed
@Bergmann89 Bergmann89 deleted the issue-256 branch March 26, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant